local skill = fk.CreateSkill{
  name = "tea__dangkou",
}
---@type TrigSkelSpec<AimFunc>
local dangkou = {
  anim_type = "drawcard",
  can_trigger = function(self, event, target, player, data)
    return player:hasSkill(skill.name) and player == target and data.card.is_damage_card and data.card.type == Card.TypeTrick and data.firstTarget
  end,
  on_use = function(self, event, target, player, data)
    player:showCards(player:getCardIds("h"))
    local suits = {}
    for _, id in ipairs(player:getCardIds("h")) do
      table.insertIfNeed(suits, Fk:getCardById(id).suit)
    end
    local num = 4 - #suits
    if not data.extra_data then
      data.use.extra_data = {tea__dangkou = num}
    elseif type(data.extra_data) == "table" then
      data.use.extra_data.tea__dangkou = num
    end
  end,
}
---@type TrigSkelSpec<UseCardFunc>
local dangkou_re = {
  can_refresh = function(self, event, target, player, data)
    if player:hasSkill(skill.name, true) and data.extra_data and target == player then
      return data.extra_data.tea__dangkou and data.damageDealt
    end
  end,
  on_refresh = function(self, event, target, player, data)
    player:drawCards(data.extra_data.tea__dangkou, skill.name)
  end,
}
skill:addEffect(fk.TargetSpecified, dangkou)
skill:addEffect(fk.CardUseFinished, dangkou_re)
return skill